/**
 * Copyright (c) 2009 Cerner Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Cerner Corporation - initial API and implementation
 */
package com.cerner.system.rest.internal.arguments;

import java.util.List;

/**
 * Internal API to verify that an scalar argument is not {@code null}.
 * 
 * @author Alex Horn
 */
public class NotNullValidator extends AbstractValidator {

  public boolean canValidate(Object argument) {
    return true;
  }

  public boolean isValid(Object argument) {
    if (argument == null) {
      return false;
    }

    return true;
  }

  public String message(List<String> names) {
    return concat(names).concat(" must not be null");
  }

}
